package ink.lovejinhu.leetcode;

import ink.lovejinhu.common.ListNode;

/**
 * @author jinhu
 * created 2021-07-07 9:12
 */
public class Solution_0206 {
    /**
     * 链表反转
     *
     * @param head
     * @return
     */
    public ListNode reverseList(ListNode head) {
        ListNode pre = null;
        ListNode param = head;
        while (param != null) {
            ListNode temp = param.next;
            param.next = pre;
            pre = param;
            param = temp;

        }
        return pre;
    }
}
